package test.liu.www;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LIUYANJIAO
 * Date: 2024-05-14
 * Time: 10:34
 */
public class Dog {
    //成员变量
    private String name;
    private int age;
    private String color;
    static private String address;
    static {
        address="后陡门";
    }

    //成员方法
    private void test(){

        System.out.println("小狗乖乖~小狗乖乖~~");
    }

    //构造方法
    public Dog(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }

    //普通方法
    public void print(){
    System.out.println(name+age+"岁了"+"是一只"+color+"的小狗~"+"家住"+address);
}

    public void testcopy(){
        this.test();
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    //主方法
    public static void main(String[] args) {
        Dog dog1=new Dog("红包",2,"黄色");
        Dog dog2=new Dog("小狼",1,"黑色");


        dog1.print();
        dog2.print();

    }
}
